nums = list(map(int, input().split()))
dp = [0]
dp[0][i] = min(dp[0][i-1],dp[1][i-1]) + nums[i-1]
dp[1][i] = min(dp[0][i-2],dp[1][i-2]) + nums[i-2]
